const unpackageCleanLog = (bytes) => {
    let DATA = bytes.slice(1, bytes.length - 1);
    const SIID = DATA[0];
    const PIID = DATA[1];
    const TYPE = DATA[2];
    const PACKAGE_ID = DATA[3];
    if (PACKAGE_ID == 0) return { PACKAGE_ID };
    if (TYPE == 128 && SIID == 6 && PIID == 1) {
        if (PACKAGE_ID == 1) {
            /**
             * |   4BYTES    |   4BYTES  |   4BYTES   |           52BYTE           |
             * |  TimeStamp  |  WORKTIME |  OVPTIMES  |          EXTRADATA         |
             */
            const rawData = DATA.slice(4);
            // 记录时间
            const timestamp = rawData.slice(0, 4).readUInt32LE();
            // 刷牙时长
            const workTime = rawData.slice(4, 6).readUInt16LE();
            // 用户设定的刷牙时长
            const workTimeSetting = rawData.slice(6, 8).readUInt16LE();
            // 过压时长
            const ovpTimes = rawData.slice(8, 10).readUInt16LE();
            const extendsData = rawData.slice(12);
            const totalTime = rawData.slice(12,13).readUint8();
            return {
                PACKAGE_ID,
                timestamp,
                workTime,
                ovpTimes,
                workTimeSetting,
                extendsData,
                rawData,
                totalTime
            };
        } else {
            /**
             * |           64BYTE           |
             * |          EXTRADATA         |
             */
            const rawData = DATA.slice(4);
            return {
                PACKAGE_ID,
                rawData,
            };
        }
    }
};

// 提取 extendsData（假设从第13字节开始）
const extendsData = Buffer.from('c006018001798746682b00780000002b0000001900190019001900190019001900190019001900190019000900190019001900190019001900190019001900090031000900c0', 'hex');

// 解析覆盖率
const coverage = unpackageCleanLog(extendsData);
console.log('左上区域覆盖率:', coverage);